#ifndef _EPOLLLOOP_H_
#define _EPOLLLOOP_H_
#include<vector>

#include<sys/epoll.h>
#include<sys/eventfd.h>

#include"Accept.h"
#include"SocketIO.h"

using std::vector;

namespace http_server
{
class EpollLoop
{
public:
    EpollLoop(Accept& aaccept);
    void Loop();
    void Stop();
    void addEvent(int fd);
    void delEvent(int fd);

private:
    void epollWait();
    int epollfdCreate();
    int eventfdCreate();
    
  
private:
    Accept _accept;
    int _epfd;
    int _eventfd;
    vector<epoll_event> _events;
    bool _status;
};

}

#endif